package com.shxzz.easy12306.services.ticket.controller;

import com.shxzz.easy12306.framework.starter.convention.result.Result;
import com.shxzz.easy12306.framework.starter.convention.result.Results;
import com.shxzz.easy12306.services.ticket.dto.req.RegionStationQueryReqDTO;
import com.shxzz.easy12306.services.ticket.dto.resp.RegionStationQueryRespDTO;
import com.shxzz.easy12306.services.ticket.dto.resp.StationQueryRespDTO;
import com.shxzz.easy12306.services.ticket.service.RegionStationService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 地区间站点信息控制层
 * @author shxzz
 * @create 2024-03-13-14:30
 */
@RequiredArgsConstructor
@RestController
public class RegionStationController {

    private final RegionStationService regionStationService;

    /**
     * 查询站点、地区信息
     */
    @GetMapping("/api/ticket-service/region-station/query")
    public Result<List<RegionStationQueryRespDTO>> listRegionStation(RegionStationQueryReqDTO requestParam) {
        return Results.success(regionStationService.listRegionStation(requestParam));
    }

    /**
     * 查询车站站点集合信息
     */
    @GetMapping("/api/ticket-service/station/all")
    public Result<List<StationQueryRespDTO>> listAllStation() {
        return Results.success(regionStationService.listAllStation());
    }

}
